#include <stdio.h>

#include "utringbuffer.h"

int main() {
	int i, *p;
	UT_ringbuffer *history;

	utringbuffer_new(history, 7, &ut_int_icd);
	for(i = 0; i < 10; i++) utringbuffer_push_back(history, &i);

	for(p = (int *)utringbuffer_front(history); p != NULL; p = (int *)utringbuffer_next(history, p))
		printf("%d\n", *p);

	for(i = 0; i < utringbuffer_len(history); i++) {
		p = utringbuffer_eltptr(history, i);
		printf("%d\n", *p);
	}

	utringbuffer_free(history);
	return 0;
}

